package cn.ibdsr.human.warpper;

import com.alibaba.fastjson.JSONObject;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author: cdl
 * @email: iamcimon@qq.com
 * @date: 2021/8/3 7:59
 */
public abstract class BaseControllerWarpper {
    public Object obj = null;

    public BaseControllerWarpper(Object obj) {
        this.obj = obj;
    }

    public Object warp() {
        if (!(this.obj instanceof List)) {
            if (this.obj instanceof Map) {
                Map<String, Object> map = (Map)this.obj;
                this.warpTheMap(map);
                return map;
            } else {
                return this.obj;
            }
        } else {
            List<Map<String, Object>> list = (List)this.obj;
            Iterator var2 = list.iterator();

            while(var2.hasNext()) {
                Map<String, Object> map = (Map)var2.next();
                this.warpTheMap(map);
            }

            return list;
        }
    }

    protected abstract void warpTheMap(Map<String, Object> var1);
}
